pub.bind(window,'load',function(){
    var pts=document.getElementsByTagName('input');
    var pp=document.getElementsByClassName('bl_p')[0];
    // console.log(pts,pp);
    pts[2].onclick=function(){
        if(localStorage.user==pts[0].value&&localStorage.pass==pts[1].value){
            localStorage.login='true';
            // 再判断哈希词是否等于index.link等
            if(location.hash=='#index'){
                location.href='../index.html';
            }else if(location.hash=='#link'){
                location.href='../pages/link.html';
            }else if(location.hash=='#detail'){
                location.href='../pages/detail.html';
            }else{
                 location.href='../index.html';
            }   
        }else{
            pp.style.color='red';
        }
    }
    // 给取消按钮添加返回事件
    var del=document.querySelector('.dl-del');
    // console.log(del);
    del.onclick=function(){
        if(location.hash=='#index'){
            location.href='../index.html';
        }else if(location.hash=='#link'){
            location.href='../pages/link.html';
        }else if(location.hash=='#detail'){
            location.href='../pages/detail.html';
        }else{
             location.href='../index.html';
        }   
    }


})